

for i,v in ipairs(load_excel('英雄设置.xlsx', '英雄技能')) do
    local name = v.name
    v.max_level = 5
    v.skill_class = '英雄技能'
    v.skill_type = 'passive'

    v.get_rate = function(self)
        return self.level * 200
    end
    if v['触发']=='自动' then
        v.cool = 10
        v.tip = [[【概率触发】|n攻击对目标造成伤害并'sx_tip'|n|n冷却时间：10秒]]
    else
        v.odds = 10
        v.tip = [[【自动触发】|n攻击几率对目标造成伤害并'sx_tip'|n|n触发几率：10%]]
    end
    v.odds = 0
    
    v.sx_add = function(self)
        return 15 * self.level
    end
    v.sx_tip = function(self)
        local key = self['属性']
        local data1 = self:sx_add()
        if key=='治疗加成' then
            return ('恢复%s%%生命'):format(data1/5)
        end
        if key=='攻击吸血' then
            return ('恢复%s%%攻击的生命'):format(data1*4)
        end
        return ('提升|cff00ff00%0.f%%%s|r，持续3.5秒'):format(data1,key)
    end
    ac.lni('skill',name,v)
end

ac.buff('技能临时属性'){
    on_cover = function(self)
        self:set_remaining(self.time)
        return false
    end,
    on_add = function(self)
        local hero = self.owner
        self:gc(hero:add(self.key,self.num))
    end
}

ac.game:event '单位-攻击触发被动'(function(_,hero,target,skill)
    local key = skill['属性']
    if skill.skill_class=='英雄技能' and key then
        if key~='治疗加成' and key~='攻击吸血' then
            local data1 = skill:sx_add()
            hero:add_buff('技能临时属性'){
                key = key,
                num = data1,
                time = 3.5
            }
        end
    end
end)